#ifndef MEASURELISTENER_H
#define MEASURELISTENER_H

#include "spatial3danalysis/analysis3dlistener.h"
#include <QWidget>
#include "mathengine/vector3.h"

class DistanceMeasure;
class AreaMeasure;
class CMeasureListener : public EarthView::World::Spatial3D::Analysis::CAnalysis3DListener
{

public:

	CMeasureListener();

	~CMeasureListener();

	virtual ev_void onAnalysisEnd(EarthView::World::Spatial3D::Analysis::IAnalysis3DTool* tool);

	virtual ev_void onMouseClicked(EarthView::World::Spatial3D::Analysis::IAnalysis3DTool* pTool);

	void setWidget(QWidget* w);

	void setAreaUnit(const EVString& unitTxt);

	void clearDis();

	void clearArea();

private:

	DistanceMeasure* mpDistanceMeasure;
	AreaMeasure* mpAreaMeasure;
	ev_real64 mStraightDistance; 
	ev_real64 mClampedDistance;
	ev_real64 mProjArea; 
	ev_real64 mClampArea;
	EVString mUnitTxt;
	EarthView::World::Spatial::Math::CVector3 mStartPoint;
	EarthView::World::Spatial::Math::CVector3 mEndPoint;

	//std::vector<EarthView::World::Spatial::Math::CVector3> mPointList;

};

#endif
